\(\int \csc ^5(e+f x) (a+b \sec ^2(e+f x))^2 \, dx\) [20]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 141 \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {\left (3 a^2+30 a b+35 b^2\right ) \text {arctanh}(\cos (e+f x))}{8 f}-\frac {(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac {\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac {b (6 a+7 b) \sec (e+f x)}{3 f}+\frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f} \]

[Out]

-1/8*(3*a^2+30*a*b+35*b^2)*arctanh(cos(f*x+e))/f-1/24*(3*a+7*b)^2*cot(f*x+e)*csc(f*x+e)/f-1/12*(3*a^2+6*a*b+7*
b^2)*cot(f*x+e)*csc(f*x+e)^3/f+1/3*b*(6*a+7*b)*sec(f*x+e)/f+1/3*b^2*csc(f*x+e)^4*sec(f*x+e)^3/f

Rubi [A] (verified)

Time = 0.18 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {4218, 473, 467, 464, 212} \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {\left (3 a^2+30 a b+35 b^2\right ) \text {arctanh}(\cos (e+f x))}{8 f}-\frac {\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac {b (6 a+7 b) \sec (e+f x)}{3 f}-\frac {(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}+\frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f} \]

[In]

Int[Csc[e + f*x]^5*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-1/8*((3*a^2 + 30*a*b + 35*b^2)*ArcTanh[Cos[e + f*x]])/f - ((3*a + 7*b)^2*Cot[e + f*x]*Csc[e + f*x])/(24*f) -
((3*a^2 + 6*a*b + 7*b^2)*Cot[e + f*x]*Csc[e + f*x]^3)/(12*f) + (b*(6*a + 7*b)*Sec[e + f*x])/(3*f) + (b^2*Csc[e
 + f*x]^4*Sec[e + f*x]^3)/(3*f)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 464

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[c*(e*x)^(m +
 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] + Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(a*e^n*(m + 1)), In
t[(e*x)^(m + n)*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[n] ||
GtQ[e, 0]) && ((GtQ[n, 0] && LtQ[m, -1]) || (LtQ[n, 0] && GtQ[m + n, -1])) &&  !ILtQ[p, -1]

Rule 467

Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2), x_Symbol] :> Simp[(-a)^(m/2 - 1)*(b*c - a*d)*x
*((a + b*x^2)^(p + 1)/(2*b^(m/2 + 1)*(p + 1))), x] + Dist[1/(2*b^(m/2 + 1)*(p + 1)), Int[x^m*(a + b*x^2)^(p +
1)*ExpandToSum[2*b*(p + 1)*Together[(b^(m/2)*(c + d*x^2) - (-a)^(m/2 - 1)*(b*c - a*d)*x^(-m + 2))/(a + b*x^2)]
 - ((-a)^(m/2 - 1)*(b*c - a*d))/x^m, x], x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] &
& ILtQ[m/2, 0] && (IntegerQ[p] || EqQ[m + 2*p + 1, 0])

Rule 473

Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^2, x_Symbol] :> Simp[c^2*(e*x)^(m
 + 1)*((a + b*x^n)^(p + 1)/(a*e*(m + 1))), x] - Dist[1/(a*e^n*(m + 1)), Int[(e*x)^(m + n)*(a + b*x^n)^p*Simp[b
*c^2*n*(p + 1) + c*(b*c - 2*a*d)*(m + 1) - a*(m + 1)*d^2*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && Ne
Q[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[m, -1] && GtQ[n, 0]

Rule 4218

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*sin[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = F
reeFactors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff*x)^n)^p/(ff*x)^(n*p
)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p
]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {\left (b+a x^2\right )^2}{x^4 \left (1-x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{f} \\ & = \frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}-\frac {\text {Subst}\left (\int \frac {b (6 a+7 b)+3 a^2 x^2}{x^2 \left (1-x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{3 f} \\ & = -\frac {\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}+\frac {\text {Subst}\left (\int \frac {-4 b (6 a+7 b)-3 \left (3 a^2+6 a b+7 b^2\right ) x^2}{x^2 \left (1-x^2\right )^2} \, dx,x,\cos (e+f x)\right )}{12 f} \\ & = -\frac {(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac {\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}-\frac {\text {Subst}\left (\int \frac {8 b (6 a+7 b)+(3 a+7 b)^2 x^2}{x^2 \left (1-x^2\right )} \, dx,x,\cos (e+f x)\right )}{24 f} \\ & = -\frac {(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac {\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac {b (6 a+7 b) \sec (e+f x)}{3 f}+\frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f}-\frac {\left (3 a^2+30 a b+35 b^2\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (e+f x)\right )}{8 f} \\ & = -\frac {\left (3 a^2+30 a b+35 b^2\right ) \text {arctanh}(\cos (e+f x))}{8 f}-\frac {(3 a+7 b)^2 \cot (e+f x) \csc (e+f x)}{24 f}-\frac {\left (3 a^2+6 a b+7 b^2\right ) \cot (e+f x) \csc ^3(e+f x)}{12 f}+\frac {b (6 a+7 b) \sec (e+f x)}{3 f}+\frac {b^2 \csc ^4(e+f x) \sec ^3(e+f x)}{3 f} \\ \end{align*}

Mathematica [A] (verified)

Time = 9.79 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.55 \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {\left (b+a \cos ^2(e+f x)\right )^2 \left (\left (90 a^2+132 a b-102 b^2+\left (6 a^2+60 a b+70 b^2\right ) \cos (4 (e+f x))-3 \left (3 a^2+30 a b+35 b^2\right ) \cos (6 (e+f x))\right ) \cot (e+f x) \csc ^3(e+f x)+\frac {1}{2} \left (105 a^2+282 a b+329 b^2\right ) (\cos (e+f x)+\cos (3 (e+f x))) \csc ^4(e+f x)+96 \left (3 a^2+30 a b+35 b^2\right ) \cos ^4(e+f x) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )\right ) \sec ^4(e+f x)}{192 f (a+2 b+a \cos (2 (e+f x)))^2} \]

[In]

Integrate[Csc[e + f*x]^5*(a + b*Sec[e + f*x]^2)^2,x]

[Out]

-1/192*((b + a*Cos[e + f*x]^2)^2*((90*a^2 + 132*a*b - 102*b^2 + (6*a^2 + 60*a*b + 70*b^2)*Cos[4*(e + f*x)] - 3
*(3*a^2 + 30*a*b + 35*b^2)*Cos[6*(e + f*x)])*Cot[e + f*x]*Csc[e + f*x]^3 + ((105*a^2 + 282*a*b + 329*b^2)*(Cos
[e + f*x] + Cos[3*(e + f*x)])*Csc[e + f*x]^4)/2 + 96*(3*a^2 + 30*a*b + 35*b^2)*Cos[e + f*x]^4*(Log[Cos[(e + f*
x)/2]] - Log[Sin[(e + f*x)/2]]))*Sec[e + f*x]^4)/(f*(a + 2*b + a*Cos[2*(e + f*x)])^2)

Maple [A] (verified)

Time = 0.56 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.50

method result size
derivativedivides \(\frac {a^{2} \left (\left (-\frac {\csc \left (f x +e \right )^{3}}{4}-\frac {3 \csc \left (f x +e \right )}{8}\right ) \cot \left (f x +e \right )+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )+2 a b \left (-\frac {1}{4 \sin \left (f x +e \right )^{4} \cos \left (f x +e \right )}-\frac {5}{8 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {15}{8 \cos \left (f x +e \right )}+\frac {15 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )+b^{2} \left (-\frac {1}{4 \sin \left (f x +e \right )^{4} \cos \left (f x +e \right )^{3}}+\frac {7}{12 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )^{3}}-\frac {35}{24 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {35}{8 \cos \left (f x +e \right )}+\frac {35 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )}{f}\) \(211\)
default \(\frac {a^{2} \left (\left (-\frac {\csc \left (f x +e \right )^{3}}{4}-\frac {3 \csc \left (f x +e \right )}{8}\right ) \cot \left (f x +e \right )+\frac {3 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )+2 a b \left (-\frac {1}{4 \sin \left (f x +e \right )^{4} \cos \left (f x +e \right )}-\frac {5}{8 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {15}{8 \cos \left (f x +e \right )}+\frac {15 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )+b^{2} \left (-\frac {1}{4 \sin \left (f x +e \right )^{4} \cos \left (f x +e \right )^{3}}+\frac {7}{12 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )^{3}}-\frac {35}{24 \sin \left (f x +e \right )^{2} \cos \left (f x +e \right )}+\frac {35}{8 \cos \left (f x +e \right )}+\frac {35 \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{8}\right )}{f}\) \(211\)
norman \(\frac {\frac {a^{2}+2 a b +b^{2}}{64 f}+\frac {\left (a^{2}+2 a b +b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{14}}{64 f}+\frac {\left (5 a^{2}+26 a b +21 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}}{64 f}+\frac {\left (5 a^{2}+26 a b +21 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{12}}{64 f}-\frac {\left (3 a^{2}+29 a b +42 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{8}}{4 f}+\frac {\left (39 a^{2}+422 a b +511 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{6}}{32 f}-\frac {\left (63 a^{2}+654 a b +847 b^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{96 f}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}+\frac {\left (3 a^{2}+30 a b +35 b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{8 f}\) \(258\)
parallelrisch \(\frac {55296 \left (\frac {\cos \left (3 f x +3 e \right )}{3}+\cos \left (f x +e \right )\right ) \left (a^{2}+10 a b +\frac {35}{3} b^{2}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )-63 \left (\left (3 a^{2}+\frac {218}{7} a b +\frac {121}{3} b^{2}\right ) \cos \left (3 f x +3 e \right )+\left (\frac {80}{3} a^{2}+\frac {1504}{21} a b +\frac {752}{9} b^{2}\right ) \cos \left (2 f x +2 e \right )+\left (\frac {32}{21} a^{2}+\frac {320}{21} a b +\frac {160}{9} b^{2}\right ) \cos \left (4 f x +4 e \right )+\left (a^{2}+\frac {218}{21} a b +\frac {121}{9} b^{2}\right ) \cos \left (5 f x +5 e \right )+\left (-\frac {16}{7} a^{2}-\frac {160}{7} a b -\frac {80}{3} b^{2}\right ) \cos \left (6 f x +6 e \right )+\left (-a^{2}-\frac {218}{21} a b -\frac {121}{9} b^{2}\right ) \cos \left (7 f x +7 e \right )+\left (-3 a^{2}-\frac {218}{7} a b -\frac {121}{3} b^{2}\right ) \cos \left (f x +e \right )+\frac {160 a^{2}}{7}+\frac {704 a b}{21}-\frac {544 b^{2}}{21}\right ) \sec \left (\frac {f x}{2}+\frac {e}{2}\right )^{4} \csc \left (\frac {f x}{2}+\frac {e}{2}\right )^{4}}{49152 f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(279\)
risch \(\frac {{\mathrm e}^{i \left (f x +e \right )} \left (9 a^{2} {\mathrm e}^{12 i \left (f x +e \right )}+90 a b \,{\mathrm e}^{12 i \left (f x +e \right )}+105 b^{2} {\mathrm e}^{12 i \left (f x +e \right )}-6 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}-60 a b \,{\mathrm e}^{10 i \left (f x +e \right )}-70 b^{2} {\mathrm e}^{10 i \left (f x +e \right )}-105 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}-282 a b \,{\mathrm e}^{8 i \left (f x +e \right )}-329 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}-180 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}-264 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+204 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}-105 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-282 a b \,{\mathrm e}^{4 i \left (f x +e \right )}-329 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-6 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-60 a b \,{\mathrm e}^{2 i \left (f x +e \right )}-70 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+9 a^{2}+90 a b +105 b^{2}\right )}{12 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{4}}-\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) a^{2}}{8 f}-\frac {15 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) a b}{4 f}-\frac {35 \ln \left ({\mathrm e}^{i \left (f x +e \right )}+1\right ) b^{2}}{8 f}+\frac {3 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) a^{2}}{8 f}+\frac {15 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) a b}{4 f}+\frac {35 \ln \left ({\mathrm e}^{i \left (f x +e \right )}-1\right ) b^{2}}{8 f}\) \(461\)

[In]

int(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/f*(a^2*((-1/4*csc(f*x+e)^3-3/8*csc(f*x+e))*cot(f*x+e)+3/8*ln(csc(f*x+e)-cot(f*x+e)))+2*a*b*(-1/4/sin(f*x+e)^
4/cos(f*x+e)-5/8/sin(f*x+e)^2/cos(f*x+e)+15/8/cos(f*x+e)+15/8*ln(csc(f*x+e)-cot(f*x+e)))+b^2*(-1/4/sin(f*x+e)^
4/cos(f*x+e)^3+7/12/sin(f*x+e)^2/cos(f*x+e)^3-35/24/sin(f*x+e)^2/cos(f*x+e)+35/8/cos(f*x+e)+35/8*ln(csc(f*x+e)
-cot(f*x+e))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 286 vs. \(2 (131) = 262\).

Time = 0.26 (sec) , antiderivative size = 286, normalized size of antiderivative = 2.03 \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {6 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{6} - 10 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 16 \, {\left (6 \, a b + 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 16 \, b^{2} - 3 \, {\left ({\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{7} - 2 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{5} + {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{3}\right )} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) + 3 \, {\left ({\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{7} - 2 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{5} + {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{3}\right )} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right )}{48 \, {\left (f \cos \left (f x + e\right )^{7} - 2 \, f \cos \left (f x + e\right )^{5} + f \cos \left (f x + e\right )^{3}\right )}} \]

[In]

integrate(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/48*(6*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^6 - 10*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^4 + 16*(6*a*b + 7
*b^2)*cos(f*x + e)^2 + 16*b^2 - 3*((3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^7 - 2*(3*a^2 + 30*a*b + 35*b^2)*cos(
f*x + e)^5 + (3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^3)*log(1/2*cos(f*x + e) + 1/2) + 3*((3*a^2 + 30*a*b + 35*b
^2)*cos(f*x + e)^7 - 2*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^5 + (3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^3)*lo
g(-1/2*cos(f*x + e) + 1/2))/(f*cos(f*x + e)^7 - 2*f*cos(f*x + e)^5 + f*cos(f*x + e)^3)

Sympy [F(-1)]

Timed out. \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\text {Timed out} \]

[In]

integrate(csc(f*x+e)**5*(a+b*sec(f*x+e)**2)**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.18 (sec) , antiderivative size = 165, normalized size of antiderivative = 1.17 \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {3 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left (3 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{6} - 5 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \cos \left (f x + e\right )^{4} + 8 \, {\left (6 \, a b + 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 8 \, b^{2}\right )}}{\cos \left (f x + e\right )^{7} - 2 \, \cos \left (f x + e\right )^{5} + \cos \left (f x + e\right )^{3}}}{48 \, f} \]

[In]

integrate(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

-1/48*(3*(3*a^2 + 30*a*b + 35*b^2)*log(cos(f*x + e) + 1) - 3*(3*a^2 + 30*a*b + 35*b^2)*log(cos(f*x + e) - 1) -
 2*(3*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^6 - 5*(3*a^2 + 30*a*b + 35*b^2)*cos(f*x + e)^4 + 8*(6*a*b + 7*b^2
)*cos(f*x + e)^2 + 8*b^2)/(cos(f*x + e)^7 - 2*cos(f*x + e)^5 + cos(f*x + e)^3))/f

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 493 vs. \(2 (131) = 262\).

Time = 0.38 (sec) , antiderivative size = 493, normalized size of antiderivative = 3.50 \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=-\frac {\frac {24 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {96 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {72 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {3 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {6 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {3 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - 12 \, {\left (3 \, a^{2} + 30 \, a b + 35 \, b^{2}\right )} \log \left (\frac {{\left | -\cos \left (f x + e\right ) + 1 \right |}}{{\left | \cos \left (f x + e\right ) + 1 \right |}}\right ) + \frac {3 \, {\left (a^{2} + 2 \, a b + b^{2} - \frac {8 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {32 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {24 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {18 \, a^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {180 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {210 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) - 1\right )}^{2}} - \frac {256 \, {\left (3 \, a b + 5 \, b^{2} + \frac {6 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {9 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {3 \, a b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {6 \, b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}}{{\left (\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}^{3}}}{192 \, f} \]

[In]

integrate(csc(f*x+e)^5*(a+b*sec(f*x+e)^2)^2,x, algorithm="giac")

[Out]

-1/192*(24*a^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 96*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 72*b^2*(
cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 3*a^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 6*a*b*(cos(f*x + e) -
 1)^2/(cos(f*x + e) + 1)^2 - 3*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 - 12*(3*a^2 + 30*a*b + 35*b^2)*lo
g(abs(-cos(f*x + e) + 1)/abs(cos(f*x + e) + 1)) + 3*(a^2 + 2*a*b + b^2 - 8*a^2*(cos(f*x + e) - 1)/(cos(f*x + e
) + 1) - 32*a*b*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 24*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 18*a^2*
(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 180*a*b*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2 + 210*b^2*(cos(f
*x + e) - 1)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)^2/(cos(f*x + e) - 1)^2 - 256*(3*a*b + 5*b^2 + 6*a*b*(c
os(f*x + e) - 1)/(cos(f*x + e) + 1) + 9*b^2*(cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 3*a*b*(cos(f*x + e) - 1)^2
/(cos(f*x + e) + 1)^2 + 6*b^2*(cos(f*x + e) - 1)^2/(cos(f*x + e) + 1)^2)/((cos(f*x + e) - 1)/(cos(f*x + e) + 1
) + 1)^3)/f

Mupad [B] (verification not implemented)

Time = 18.30 (sec) , antiderivative size = 135, normalized size of antiderivative = 0.96 \[ \int \csc ^5(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx=\frac {\frac {b^2}{3}+{\cos \left (e+f\,x\right )}^2\,\left (\frac {7\,b^2}{3}+2\,a\,b\right )+{\cos \left (e+f\,x\right )}^6\,\left (\frac {3\,a^2}{8}+\frac {15\,a\,b}{4}+\frac {35\,b^2}{8}\right )-{\cos \left (e+f\,x\right )}^4\,\left (\frac {5\,a^2}{8}+\frac {25\,a\,b}{4}+\frac {175\,b^2}{24}\right )}{f\,\left ({\cos \left (e+f\,x\right )}^7-2\,{\cos \left (e+f\,x\right )}^5+{\cos \left (e+f\,x\right )}^3\right )}-\frac {\mathrm {atanh}\left (\cos \left (e+f\,x\right )\right )\,\left (\frac {3\,a^2}{8}+\frac {15\,a\,b}{4}+\frac {35\,b^2}{8}\right )}{f} \]

[In]

int((a + b/cos(e + f*x)^2)^2/sin(e + f*x)^5,x)

[Out]

(b^2/3 + cos(e + f*x)^2*(2*a*b + (7*b^2)/3) + cos(e + f*x)^6*((15*a*b)/4 + (3*a^2)/8 + (35*b^2)/8) - cos(e + f
*x)^4*((25*a*b)/4 + (5*a^2)/8 + (175*b^2)/24))/(f*(cos(e + f*x)^3 - 2*cos(e + f*x)^5 + cos(e + f*x)^7)) - (ata
nh(cos(e + f*x))*((15*a*b)/4 + (3*a^2)/8 + (35*b^2)/8))/f